﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _3CMillingSimulator
{
    public partial class AnimationSpeed : Form
    {
        public Timer Timer { get; set; }
        private readonly int maxTimeInterval;

        public AnimationSpeed()
        {
            InitializeComponent();
            maxTimeInterval = 20;
        }

        private void speedTrackBar_ValueChanged(object sender, EventArgs e)
        {
            if (this.Timer != null)
                this.Timer.Interval = maxTimeInterval - (maxTimeInterval/(this.speedTrackBar.Maximum+1)) * this.speedTrackBar.Value;
            this.label1.Text = this.speedTrackBar.Value.ToString();
        }
    }
}
